package yunwo.cn.yzstation.presenter;

import java.util.List;

import yunwo.cn.yzstation.api.ICarOrdview;
import yunwo.cn.yzstation.api.IcarOrdModel;
import yunwo.cn.yzstation.base.BasePresenter;
import yunwo.cn.yzstation.bean.OrderinfodetailsBean;
import yunwo.cn.yzstation.model.CarordModel;
import yunwo.cn.yzstation.view.activity.CarOrderDetailsActivity;

/**
 * Created by lao on 2017/10/16.
 */

public class CarOrderDetailsPersenter extends BasePresenter<ICarOrdview> implements IcarOrdModel {
    CarOrderDetailsActivity carOrderDetailsActivity;
    ICarOrdview iCarOrdview;
    private final CarordModel mCarordModel;

    public CarOrderDetailsPersenter(CarOrderDetailsActivity carOrderDetailsActivity, ICarOrdview iCarOrdview) {
        this.carOrderDetailsActivity = carOrderDetailsActivity;
        this.iCarOrdview = iCarOrdview;
        mCarordModel = new CarordModel(carOrderDetailsActivity, this);
    }

    public void getData(String id) {
        mCarordModel.getData(id);
    }

    @Override
    public void getgetDataSuccess(List<OrderinfodetailsBean.DataBean> dataBeanList) {
        iCarOrdview.getgetDataSuccess(dataBeanList);
    }

    @Override
    public void submitSuccess() {
        iCarOrdview.submitSuccess();
    }


    public void submit(List<OrderinfodetailsBean.DataBean> selectedCollectedCars) {
        mCarordModel.submit(selectedCollectedCars);
    }
}
